export default {
  saveuser (state, val) {
    state.usertf = val
    try {
      sessionStorage.setItem('userTf', val)
    } catch (e) {}
  },
  userNames (state, val) {
    state.username = val
    try {
      sessionStorage.setItem('userName', val)
    } catch (e) {}
  },
  getToken (state, val) { // 保存token
    state.token = val
    try {
      sessionStorage.setItem('token', val)
    } catch (e) {}
  },
  getNowUserIntro (state, val) { // 得到登录用户信息
    state.nowUserIntro = val
  },
  changeUserCenter (state, val) { // 控制用户面板显示
    state.userCenter = val
  },
  getHomeGg (state, val) { // 主页面公告数据
    state.homeGg = val
  },
  getHomeImg (state, val) { // 主页图片
    state.homeImg = val
  },
  getGg (state, val) { // 公告页面数据
    state.gg = val
  },
  getGgX (state, val) { // 公告详情数据
    state.ggX = val
  },
  getHomeSearchArticle (state, val) { // 主页搜索文章数据
    state.homeSearchArticle = val
  },
  changeHomeTf (state, val) { // 用户主页数据辨别
    state.homeTf = val
  },
  denglu (state, val) { // 弹出登录界面
    state.denglutf = val
  },
  getArtical (state, val) { // 得到文章数据
    state.artical = val
  },
  getBtnartical (state, val) {
    state.btnartical = val
  },
  changeWriteDisplay (state, val) { // 改变发布文章列表的渲染状态
    state.writeDisplay = val
  },
  changeArticalDisplay (state, val) {
    state.articalDisplay = val
  },
  getArticalTitle (state, val) { // 得到发布文章的标题
    state.articalTitle = val
  },
  getArticalContent (state, val) { // 得到文章内容
    state.articalContent = val
  },
  getArticalSummary (state, val) { // 得到文章概要
    state.articalSummary = val
  },
  getArticalTag (state, val) { // 得到文章标签
    state.articalTag = val
  },
  getArticalClass (state, val) { // 得到文章分类
    state.articalClass = val
  },
  getNowArticals (state, val) { // 得到点击文章的数据
    state.nowArticals = val
  },
  getNowTalks (state, val) { // 得到点击文章的评论
    state.nowTalk = val
  },
  getNowTalkSmall (state, val) { // 得到评论的子评论
    state.nowTalkSmall = val
  },
  getMasterArticle (state, val) {
    state.nowTalkSmall.unshift(val)
  },
  getMyHome (state, val) { // 我的主页信息
    state.myHome = val
  },
  getMyArticle (state, val) { // 我的主页文章数据
    state.myArticle = val
  },
  dropMyArticle (state, val) { // 删除文章
    state.myArticle.splice(parseInt(val), 1)
  },
  getImages (state, val) { // 文章里的图片地址
    state.images.push(val)
  },
  getImagName (state, val) { // name
    state.imagName.push(val)
  }
}
